package edu.gatech.cs2340.teamrocket.control.networking.impl.messagehandler;

import edu.gatech.cs2340.teamrocket.control.networking.dialog.Dialog;
import edu.gatech.cs2340.teamrocket.control.networking.node.Node;
import edu.gatech.cs2340.teamrocket.control.networking.node.Server;
import edu.gatech.cs2340.teamrocket.control.networking.impl.message.ChatMessage;
import edu.gatech.cs2340.teamrocket.control.networking.message.Message;
import edu.gatech.cs2340.teamrocket.control.networking.messagehandler.MessageHandler;

/**
 * Default Server message handler for the Victory Trail.
 *
 * @author Joe Tacheron
 */
public class VTServerMessageHandler implements MessageHandler {

    @Override
    public void handleMessage(Node endpoint, Dialog dialog, Message message) {

        Server server = (Server)endpoint;

        if(message instanceof ChatMessage){
            server.sendAll(message);
        }
    }
}
